package com.example.weatherapp033;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.example.weatherapp033.db.Province;
import com.example.weatherapp033.util.HttpUtil;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        SharedPreferences sp = getSharedPreferences("weather", MODE_PRIVATE);
        String json=sp.getString("weather", "");
        if(!TextUtils.isEmpty(json)){
            Intent intent=new Intent(this,WeatherActivity.class);
            startActivity(intent);
            finish();
        }


    }
}